package com.hs.srm.common.utils;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.jms.Destination;

@Service
public class ProducerUtil  {
    @Autowired
    protected JmsMessagingTemplate jmsTemplate;
    public void sendMsg(String destinationName, String message) {
        System.out.println("------------ 发送消息"+ message);
        Destination destination = new ActiveMQQueue(destinationName);
       jmsTemplate.convertAndSend(destination,message);
    }

}
